﻿<UserControl x:Class="CloudStorageLight.WpfClient.ShowUrlWindow"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:CloudStorageLight.WpfClient"
             mc:Ignorable="d" Loaded="UserControl_Loaded" 
             >
    <UserControl.Resources>
        <local:BindingProxy x:Key="proxy" Data="{Binding}" />
        <Style TargetType="{x:Type Control}" x:Key="baseStyle">
            <Setter Property="FontSize" Value="{Binding Path=Data.FontSize, Source={StaticResource proxy}}" />
        </Style>
        <Style TargetType="TextBlock">
            <Setter Property="FontSize" Value="{Binding Path=Data.FontSize, Source={StaticResource proxy}}" />
        </Style>
        <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource baseStyle}"></Style>
    </UserControl.Resources>
    <Grid>
        <ContentControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib" IsTabStop="False">
            <ContentControl.Resources>
                <ResourceDictionary>
                    <ResourceDictionary.MergedDictionaries>
                        <ResourceDictionary Source="/ViewMaker.Core;component/wpf/wpfgenericresource.xaml" />
                        <ResourceDictionary Source="/ViewMaker.Core;component/wpf/wpferrorstyleresource.xaml" />
                    </ResourceDictionary.MergedDictionaries>
                </ResourceDictionary>
            </ContentControl.Resources>
            <StackPanel Name="ShowUrlVM" Orientation="Horizontal" DataContext="{Binding Mode=OneWay}" Margin="2">
                <TextBox Name="Url" IsReadOnly="True" FontSize="{Binding Path=FontSize}" Text="{Binding Path=Url, Mode=TwoWay, ValidatesOnExceptions=True, ValidatesOnDataErrors=True, NotifyOnValidationError=True }" Width="300" HorizontalAlignment="Left" Margin="5" />
                <Button Command="{Binding Path=CloseCommand,Mode=OneWay}" Width="50" HorizontalAlignment="Left" Margin="5">Close</Button>
            </StackPanel>
        </ContentControl>
    </Grid>
</UserControl>
